package net.classes;

import net.bd.MySQL;
import net.crawler.Crawler;

public class main {

	private static String url;
	private static String word;
	
	public static void setUrl(String url){
		main.url = url;
	}
	
	public static void setWord(String word){
		main.word = word;
	}
	
	public static void loader() {
		
		Crawler.cadastraUrl(url);
		Crawler.run();
		Crawler.importFormToWFSim(url);
		
		MySQL.createDmlSchema("Search");
		MySQL.truncateTable("SearchSVA");
		MySQL.truncateTable("SearchTF");
		MySQL.truncateTable("SearchIDF");
		MySQL.truncateTable("SearchSize");
		MySQL.truncateTable("SearchLEN");
		MySQL.truncateTable("SearchWEI");
		
		MySQL.populateSearchTables(url);
		MySQL.associateWithCluster(url);
		
		Clusterizer.run();
	}
	
	public static void search() {
		MySQL.search(url,word);
	}
	
}
